import api from '@/api';

/**
 * 登录接口
 */
export const loginPost = (data: any) => {
  return api.post('/medinstrument/site/customer/login', data);
};

/**
 * 退出登录接口
 */
export const logoutPost = () => {
  return api.post('/medinstrument/site/customer/logout');
};

/**
 * 上传接口
 */
export const uploadPost = (data: any) => {
  return api.post('/medinstrument/site/uploadSingleFile', data, 'file');
};

/**
 * 注册接口
 */
export const registerPost = (data: any) => {
  return api.post('/medinstrument/site/customer/customerRegister', data);
};

/**
 * 获取验证码接口
 */
export const captchaPost = (data: any) => {
  return api.post('/medinstrument/site/sms/sendMessage', data);
};

/**
 * 忘记密码接口
 */
export const changePasswordPost = (data: any) => {
  return api.post(
    `/medinstrument/site/customer/changePasswordByCaptcha?captcha=${data.captcha}&loginPhone=${data.loginPhone}&newPassword=${data.newPassword}`,
  );
};
